package com.stlm2.dems.entity;

/**
 * Created by ZLQ on 2017/9/1.
 */
public enum Graded {

    One(1) {
        public String toString() {
            return "一星";
        }
    },
    Two(2) {
        public String toString() {
            return "二星";
        }
    },
    Three(3) {
        public String toString() {
            return "三星";
        }
    },
    Four(4) {
        public String toString() {
            return "四星";
        }
    },
    Five(5) {
        public String toString() {
            return "五星";
        }
    };
    private final int val;

    Graded(int n) {
        val = n;
    }

    public int getIntValue() {
        return val;
    }

    public static Graded getByIntValue(int n) {
        switch (n) {
            case 1:
                return  One;
            case 2:
                return Two;
            case 3:
                return Three;
            case 4:
                return Four;
            case 5:
                return Five;

            default:
                return null;
        }
    }
}
